﻿namespace ConsoleApp5;

class Program
{
    static void Main(string[] args)
    {
        /*
         * 对任何字符串值使用 ToUpper() 或 ToLower() 帮助程序方法，确保这两个字符串全部大写或全部小写。
         * 对任何字符串值使用 Trim() 帮助程序方法，删除前导空格或尾随空格。
         */
        /*string value1 = " a";
        string value2 = "A ";
        Console.WriteLine(value1.Trim().ToLower() == value2.Trim().ToLower());*/

        /*
         * Contains = 字符串是否包含特定字符 EndsWith = 判断字符串是否以指定内容结尾 ，StartsWith = 判断字符串是否以指定内容开头
         */
        /*string str = "the quick brown fox jumps over the lazy dog";
        Console.WriteLine(str.Contains("fox"));
        Console.WriteLine(str.Contains("asd"));
        Console.WriteLine(str.EndsWith("asd"));

        int Amout = 1001;
        Console.WriteLine($"钱 ：{(Amout > 1000 ? 100: 200)}");*/

        //练习
        Random random = new Random();
        /*
        int next = random.Next(0, 1);
        Console.WriteLine(next == 0 ? "heads" : "tails");*/


        /*string permission = "Admin|Manager";
        int level = 55;

        if (permission.Contains("Admin") && level > 55)
        {
            Console.WriteLine("Welcome, Super Admin user.");
        }
        else if (permission.Contains("Admin") && level <= 55)
        {
            Console.WriteLine("Welcome, Admin user.");
        }
        else if (permission.Contains("Manager") && level >= 20)
        {
            Console.WriteLine("Contact an Admin for access.");
        }
        else if (permission.Contains("Manager") && level <= 20)
        {
            Console.WriteLine("You do not have sufficient privileges.");
        }
        else
        {
            Console.WriteLine("You do not have sufficient privileges.");
        }*/
        /*
        bool flag = true;
        int value = 0;
        if (flag)
        {
            value = 10;
            Console.WriteLine($"Inside the code block: {value}");
        }
        Console.WriteLine($"Outside the code block: {value}");
        */
        //练习
        /*int[] numbers = { 4, 8, 15, 16, 23, 42 };
        bool found = false;
        int total = 0;
        foreach (int number in numbers)
        {
            total += number;

            if (number == 42)
            {
                found = true;

            }

        }

        if (found)
        {
            Console.WriteLine("Set contains 42");
        }

        Console.WriteLine($"Total: {total}");*/

        /*string sku = "01-MN-L";

        string[] product = sku.Split('-');

        string type = "";
        string color = "";
        string size = "";

        //1
        switch (product[0])
        {
            case "01":
                type = "Sweat shirt";
                break;
            case "02":
                type = "T-Shirt";
                break;
            case "03":
                type = "Sweat pants";
                break;
            default:
                type = "Other";
                break;
        }
        //2
        switch (product[1])
        {
            case "BL":
                color = "Black";
                break;
            case "MN":
                color = "Maroon";
                break;
            default:
                color = "White";
                break;
        }
        //3
        switch (product[2])
        {
            case "S":
                size = "Small";
                break;
            case "M":
                size = "Medium";
                break;
            case "L":
                size = "Large";
                break;
            default:
                size = "One Size Fits All";
                break;
        }

        Console.WriteLine($"Product: {size} {color} {type}");*/

        //for循环练习
        /*for (int i = 1; i <= 100; i++)
        {
            if ((i % 3 == 0) && (i % 5 == 0))
            {
                Console.WriteLine($"{i} - FizzBuzz");
            }
            else if (i % 3 == 0)
            {
                Console.WriteLine($"{i} - Fizz");
            }
            else if (i % 5 == 0)
            {
                Console.WriteLine($"{i} - Buzz");
            }
            else
            {
                Console.WriteLine(i);
            }
        }*/

        //do while 迭代循环
        /*int g = 10, x = 10, roll = 0;

        while (g > 0 && x > 0)
        {
            roll = random.Next(1, 10);
            g -= roll;
            Console.WriteLine($"英雄攻击怪兽:{roll}滴血 怪兽剩余 {g}血");
            if (x <= 0)
            {
                continue;
            }
            if (g > 0)
            {
                roll = random.Next(1, 10);
                x -= roll;
                Console.WriteLine($"怪兽攻击英雄:{roll}滴血 英雄剩余 {x}血");
            }
        }
        Console.WriteLine(g > x ? "怪兽win" : "英雄win");*/
        
        
    }
}